package vip.xiaonuo.core.util;

import cn.afterturn.easypoi.word.WordExportUtil;
import cn.hutool.core.date.DateUtil;
import org.apache.commons.collections4.map.HashedMap;
import org.apache.poi.xwpf.usermodel.XWPFDocument;

import java.io.FileOutputStream;
import java.util.Map;


//    https://blog.csdn.net/qq_42279796/article/details/116271546

public class Word97Util {

    public static void main(String[] args) throws Exception {
        Word97Util.exportExcelWithFile();
    }

    public static void exportExcelWithFile() throws Exception {
        Map<String, Object> map = new HashedMap<>();
        map.put("name", "张宏文");
        map.put("date", DateUtil.today());

        XWPFDocument word = WordExportUtil.exportWord07("e:/aa.docx", map);
        word.write(new FileOutputStream("e:/bb.docx"));
        word.close();

    }

}
